package com.jde.parent.exception;


import com.jde.parent.result.ResultInterface;

/**
 * @description: 运行时异常不需要抛出或者处理 <br>
 * @date: 2019/12/16 14:48 <br>
 * @author: jiangde <br>
 * @version: 1.0 <br>
 */
public class ApplicationRuntimeException extends RuntimeException implements ResultInterface {

    private int code;
    private String msg;

    public ApplicationRuntimeException(ResultInterface resultInterface) {
        super(resultInterface.msg());
        this.code = resultInterface.code();
        this.msg = resultInterface.msg();
    }

    public ApplicationRuntimeException(int code, String msg) {
        super(msg);
        this.code = code;
        this.msg = msg;
    }


    @Override
    public int code() {
        return this.code;
    }

    @Override
    public String msg() {
        return this.msg;
    }
}
